The subject technology is generally directed to binary translation techniques. A software program is usually compiled for a specified platform, which may include a specified hardware architecture, a specified operating system, and/or specified libraries. A user may desire to run this software program on another platform different from the specified platform, which has a different hardware architecture, a different operating system or different libraries. In such case, the platform for which the program is compiled is referred to as the guest, and platform on which the code is to be executed is referred to as the host. In order to adjust the program for execution on the host platform, the host platform may be programmed to emulate (in software) the specified guest platform, and a binary translation may be performed to translate the software program from its original form into a new software program that can run on the host platform with the emulated specified guest platform. In binary translation, binary code for the specified guest platform is translated into binary code for the host platform.